﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace worktime.Forms
{
	public partial class FormRegularAway : Form
	{
		public FormRegularAway()
		{
			InitializeComponent();
		}

		private void FormRegularAway_Shown(object sender, EventArgs e)
		{
			dtpFrom.Value = Program.frmOptions.Values.regularAwayTimeFrom;
			dtpTo.Value = Program.frmOptions.Values.regularAwayTimeTo;
			dtpDuration.Value = Program.frmOptions.Values.regularAwayDuration;
			cbTurnOn.Checked = Program.frmOptions.Values.regularAwayEnabled;

			for (int i = 0; i < 7; ++i)
				listDaysOfWeek.SetItemChecked(i, Program.frmOptions.Values.regularAwayDaysOfWeek[i]);
		}

		private void btnOK_Click(object sender, EventArgs e)
		{
			DialogResult = DialogResult.OK;
			Close();
		}

		private void btnCancel_Click(object sender, EventArgs e)
		{
			DialogResult = DialogResult.Cancel;
			Close();
		}
	}
}
